package com.kaiyiweitong.tongxing.fragment.service_info;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridLayout;

import com.kaiyiweitong.tongxing.R;
import com.kaiyiweitong.tongxing.activity.classify.ServiceInfoActivity;
import com.kaiyiweitong.tongxing.adapter.ServiceEvaluateAdapter;
import com.kaiyiweitong.tongxing.other.SpaceItemDecoration;
import com.kaiyiweitong.tongxing.util.CommonUtil;

/**
 * Created by Administrator on 2017/12/19 0019.
 */

public class ServiceEvaluateFragment extends Fragment {
    private View mView;
    private ServiceInfoActivity mActivity;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mView = inflater.inflate(R.layout.fragment_service_evaluate, null);
        mActivity = (ServiceInfoActivity) getActivity();
        init();
        return mView;
    }

    private void init() {
        RecyclerView rv_service_evaluate = (RecyclerView) mView.findViewById(R.id.rv_service_evaluate);
        rv_service_evaluate.setLayoutManager(new GridLayoutManager(mActivity, 1, GridLayout.VERTICAL, false));
        ServiceEvaluateAdapter adapter = new ServiceEvaluateAdapter(mActivity);
        rv_service_evaluate.addItemDecoration(new SpaceItemDecoration(CommonUtil.dip2px(mActivity, 10), 1));
        rv_service_evaluate.setAdapter(adapter);


    }
}
